﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using JM.JCY.Common;
using JM.JCY.DataAccess;
using JM.JCY.BusinessEntity;

namespace JM.JCY.BusinessComponent
{
    public class AnnounceBC : JCYBusinessComponentBase<AnnounceDA>
    {
        public AnnounceBC()
            : base(new AnnounceDA())
        {
        }

        public void UpdateAnnounce(AnnounceDataSet ds)
        {
            this.DataAccess.UpdateAnnounce(ds);
        }

        public void UpdateAnnouceSingle(AnnounceDataSet.T_AnnounceDataTable dt)
        {
            this.DataAccess.UpdateAnnouceSingle(dt);
        }

        public void UpdateAnnounceReceiverSingle(AnnounceDataSet.T_Announce_ReceiverDataTable dt)
        {
            this.DataAccess.UpdateAnnounceReceiverSingle(dt);
        }

        public AnnounceDataSet.T_Announce_ReceiverDataTable GetAnnounceReceiverById(int announceId)
        {

            return this.DataAccess.GetAnnounceReceiverById(announceId);
        }

        public AnnounceDataSet.T_Announce_SearchDataTable SearchAnnounce(string subject, string status, string readStatus, DateTime? startDate, DateTime? endDate)
        {
            return this.DataAccess.SearchAnnounce(subject, status, readStatus, startDate, endDate);
        }

        public AnnounceDataSet.T_AnnounceDataTable GetAnnounce(int announceId, string subject, string status)
        {

            return this.DataAccess.GetAnnounce(announceId, subject, status);
        }

        public AnnounceDataSet.T_Announce_Search_By_UserDataTable SearchAnnounceByUser(string subject, DateTime? startDate, DateTime? endDate, int currentUserId)
        {
            return this.DataAccess.SearchAnnounceByUser(subject, startDate, endDate, currentUserId);
        }

        public AnnounceDataSet.T_AnnounceDataTable SearchAnnouncForHome(int count, int receiverId)
        {
            return this.DataAccess.SearchAnnouncForHome(count, receiverId);
        }

        public void UpdateAnnounceStatus(int annId, string userName)
        {
            this.DataAccess.UpdateAnnounceStatus(annId, userName);
        }
    }
}
